
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>10.6、Android自动化构建 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chapter11.html" />
    
    
    <link rel="prev" href="chapter10.5.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"xiaolanyun","repo":"DevOps_wiki","type":"star","size":"30px"}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    1、设计思路
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="chapter1.1.html">
            
                <a href="chapter1.1.html">
            
                    
                    1.1、参考文献
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="chapter2.html">
            
                <a href="chapter2.html">
            
                    
                    2、服务器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="chapter2.1.html">
            
                <a href="chapter2.1.html">
            
                    
                    2.1、配置静态ip
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="chapter2.2.html">
            
                <a href="chapter2.2.html">
            
                    
                    2.2、Centos7扩容
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="chapter3.html">
            
                <a href="chapter3.html">
            
                    
                    3、mysql
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="chapter3.1.html">
            
                <a href="chapter3.1.html">
            
                    
                    3.1、初始化登录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="chapter3.2.html">
            
                <a href="chapter3.2.html">
            
                    
                    3.2、mysql5.7&8.0设置用户密码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="chapter3.3.html">
            
                <a href="chapter3.3.html">
            
                    
                    3.3、mysql5.7&8.0开启远程登录权限
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="chapter3.4.html">
            
                <a href="chapter3.4.html">
            
                    
                    3.4、mysql8.0驱动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="chapter3.5.html">
            
                <a href="chapter3.5.html">
            
                    
                    3.5、mysql更改端口号
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="chapter4.html">
            
                <a href="chapter4.html">
            
                    
                    4、mongodb
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="chapter4.1.html">
            
                <a href="chapter4.1.html">
            
                    
                    4.1、安装部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="chapter4.2.html">
            
                <a href="chapter4.2.html">
            
                    
                    4.2、集群测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="chapter5.html">
            
                <a href="chapter5.html">
            
                    
                    5、redis
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="chapter5.1.html">
            
                <a href="chapter5.1.html">
            
                    
                    5.1、安装部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="chapter5.2.html">
            
                <a href="chapter5.2.html">
            
                    
                    5.2、集群测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="chapter5.3.html">
            
                <a href="chapter5.3.html">
            
                    
                    5.3、配置服务
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="chapter6.html">
            
                <a href="chapter6.html">
            
                    
                    6、Nexus
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="chapter6.1.html">
            
                <a href="chapter6.1.html">
            
                    
                    6.1、windows&linux_maven
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="chapter6.2.html">
            
                <a href="chapter6.2.html">
            
                    
                    6.2、Nexus
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="chapter7.html">
            
                <a href="chapter7.html">
            
                    
                    7、ZenTao
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="chapter7.1.html">
            
                <a href="chapter7.1.html">
            
                    
                    7.1、安装部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="chapter7.2.html">
            
                <a href="chapter7.2.html">
            
                    
                    7.2、禅道部分概念释义
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="chapter8.html">
            
                <a href="chapter8.html">
            
                    
                    8、jenkins
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="chapter8.1.html">
            
                <a href="chapter8.1.html">
            
                    
                    8.1、git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="chapter8.2.html">
            
                <a href="chapter8.2.html">
            
                    
                    8.2、gradle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="chapter8.3.html">
            
                <a href="chapter8.3.html">
            
                    
                    8.3、sdk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="chapter8.4.html">
            
                <a href="chapter8.4.html">
            
                    
                    8.4、jenkins安装部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="chapter9.html">
            
                <a href="chapter9.html">
            
                    
                    9、Sonar
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="chapter9.1.html">
            
                <a href="chapter9.1.html">
            
                    
                    9.1、SonarQube
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="chapter9.2.html">
            
                <a href="chapter9.2.html">
            
                    
                    9.2、配置服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="chapter9.3.html">
            
                <a href="chapter9.3.html">
            
                    
                    9.3、SonarQubeScanner
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="chapter9.4.html">
            
                <a href="chapter9.4.html">
            
                    
                    9.4、集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="chapter10.html">
            
                <a href="chapter10.html">
            
                    
                    10、Android本地商城被测件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="chapter10.1.html">
            
                <a href="chapter10.1.html">
            
                    
                    10.1、Android本地商城需求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="chapter10.2.html">
            
                <a href="chapter10.2.html">
            
                    
                    10.2、Android本地商城功能设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="chapter10.3.html">
            
                <a href="chapter10.3.html">
            
                    
                    10.3、Android本地商城业务及数据库设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="chapter10.4.html">
            
                <a href="chapter10.4.html">
            
                    
                    10.4、Android本地商城UI设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="chapter10.5.html">
            
                <a href="chapter10.5.html">
            
                    
                    10.5、Android本地商城托管地址
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.11.6" data-path="chapter10.6.html">
            
                <a href="chapter10.6.html">
            
                    
                    10.6、Android自动化构建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="chapter11.html">
            
                <a href="chapter11.html">
            
                    
                    11、Appium_自动化测试框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="chapter11.1.html">
            
                <a href="chapter11.1.html">
            
                    
                    11.1、总体设计思路
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="chapter11.2.html">
            
                <a href="chapter11.2.html">
            
                    
                    11.2、环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="chapter11.3.html">
            
                <a href="chapter11.3.html">
            
                    
                    11.3、自动化测试框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.4" data-path="chapter11.4.html">
            
                <a href="chapter11.4.html">
            
                    
                    11.4、自动化测试框架托管地址
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.5" data-path="chapter11.5.html">
            
                <a href="chapter11.5.html">
            
                    
                    11.5、并行测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.6" data-path="chapter11.6.html">
            
                <a href="chapter11.6.html">
            
                    
                    11.6、并行测试框架托管地址
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.7" data-path="chapter11.7.html">
            
                <a href="chapter11.7.html">
            
                    
                    11.7、持续集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="chapter12.html">
            
                <a href="chapter12.html">
            
                    
                    12、Maxim_Monkey
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="chapter12.1.html">
            
                <a href="chapter12.1.html">
            
                    
                    12.1、Maxim_Monkey使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="chapter12.2.html">
            
                <a href="chapter12.2.html">
            
                    
                    12.2、Maxim_Monkey托管地址
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="chapter12.3.html">
            
                <a href="chapter12.3.html">
            
                    
                    12.3、持续集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="chapter13.html">
            
                <a href="chapter13.html">
            
                    
                    13、postman&newman
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="chapter13.1.html">
            
                <a href="chapter13.1.html">
            
                    
                    13.1、postman接口测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="chapter13.2.html">
            
                <a href="chapter13.2.html">
            
                    
                    13.2、newman
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="chapter13.3.html">
            
                <a href="chapter13.3.html">
            
                    
                    13.3、接口自动化示例托管地址
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="chapter13.4.html">
            
                <a href="chapter13.4.html">
            
                    
                    13.4、持续集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="chapter14.html">
            
                <a href="chapter14.html">
            
                    
                    14、open-falcon
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="chapter14.1.html">
            
                <a href="chapter14.1.html">
            
                    
                    14.1、环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="chapter14.2.html">
            
                <a href="chapter14.2.html">
            
                    
                    14.2、单机&分布式安装说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="chapter14.3.html">
            
                <a href="chapter14.3.html">
            
                    
                    14.3、dashboard
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="chapter14.4.html">
            
                <a href="chapter14.4.html">
            
                    
                    14.4、Agent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.5" data-path="chapter14.5.html">
            
                <a href="chapter14.5.html">
            
                    
                    14.5、Transfer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.6" data-path="chapter14.6.html">
            
                <a href="chapter14.6.html">
            
                    
                    14.6、Graph
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.7" data-path="chapter14.7.html">
            
                <a href="chapter14.7.html">
            
                    
                    14.7、API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.8" data-path="chapter14.8.html">
            
                <a href="chapter14.8.html">
            
                    
                    14.8、HBS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.9" data-path="chapter14.9.html">
            
                <a href="chapter14.9.html">
            
                    
                    14.9、Judge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.10" data-path="chapter14.10.html">
            
                <a href="chapter14.10.html">
            
                    
                    14.10、Alarm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.11" data-path="chapter14.11.html">
            
                <a href="chapter14.11.html">
            
                    
                    14.11、Nodata
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.12" data-path="chapter14.12.html">
            
                <a href="chapter14.12.html">
            
                    
                    14.12、Aggregator
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="chapter15.html">
            
                <a href="chapter15.html">
            
                    
                    15、gitbook_wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.1" data-path="chapter15.1.html">
            
                <a href="chapter15.1.html">
            
                    
                    15.1、wiki搭建使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="chapter16.html">
            
                <a href="chapter16.html">
            
                    
                    16、前端
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="chapter16.1.html">
            
                <a href="chapter16.1.html">
            
                    
                    16.1、UI设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="chapter16.2.html">
            
                <a href="chapter16.2.html">
            
                    
                    16.2、前端托管地址
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="chapter17.html">
            
                <a href="chapter17.html">
            
                    
                    17、附加说明
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.18.1" data-path="chapter17.1.html">
            
                <a href="chapter17.1.html">
            
                    
                    17.1、服务器配置一览
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >10.6、Android自动化构建</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="106&#x3001;android&#x81EA;&#x52A8;&#x5316;&#x6784;&#x5EFA;">10.6&#x3001;Android&#x81EA;&#x52A8;&#x5316;&#x6784;&#x5EFA;</h3>
<p>1&#x3001;jenkins&#x4E2D;job&#x914D;&#x7F6E;</p>
<p><img src="image/10.6.0.png" alt=""></p>
<hr>
<p>2&#x3001;&#x84B2;&#x516C;&#x82F1;&#x5E73;&#x53F0;</p>
<p><a href="https://www.pgyer.com/doc/view/jenkins_plugin" target="_blank">&#x84B2;&#x516C;&#x82F1;&#x63D2;&#x4EF6;&#x8BF4;&#x660E;</a></p>
<p><a href="https://www.pgyer.com/doc/api" target="_blank">&#x84B2;&#x516C;&#x82F1;&#x5E73;&#x53F0;api</a></p>
<p>2.1&#x3001;job&#x53C2;&#x6570;</p>
<pre><code>ENVIRONMENT_BUILD
release
debbug
&lt;font color=&quot;red&quot;&gt;&#x6253;&#x5305;&#x73AF;&#x5883;:Release -&#x6B63;&#x5F0F;&#x7B7E;&#x540D;&#x5305;;Debug -&#x6E2C;&#x8A66;&#x7B7E;&#x540D;&#x5305;&lt;/font&gt;

APP_VERSION
1.1.0
&lt;font color=&quot;red&quot;&gt;&#x81EA;&#x5B9A;&#x4E49;&#x7248;&#x672C;&#x53F7;&lt;/font&gt;

IS_JENKINS
true
&lt;font color=&quot;red&quot;&gt;&#x8868;&#x793A;&#x5305;&#x6784;&#x5EFA;&#x4F86;&#x81EA;Jenkins&#x5E73;&#x53F0;&lt;/font&gt;

BRANCH
&#x9009;&#x62E9;&#x5206;&#x652F;&#x6784;&#x5EFA;

H 12 * * *

clean
-PIS_JENKINS=${IS_JENKINS}
-PAPP_VERSION=${APP_VERSION}
assemble&apos;${ENVIRONMENT_BUILD}&apos;



Build Environment
#${BUILD_NUMBER}_${BUILD_USER_FIRST_NAME}_${APP_VERSION}_${ENVIRONMENT_BUILD}

upload to pgyer with apiV1
pgyer uKey:472425e09de5c592ebdc0476905ba97e
pgyer api_key:250afd10fbdf0e45ad35abc072e53d10
scandir:${WORKSPACE}/apk/${ENVIRONMENT_BUILD}
file wildcard:XiaoLanYunMart-v${APP_VERSION}-${ENVIRONMENT_BUILD}-${BUILD_TIME}.apk
</code></pre><p><img src="image/10.6.1.PNG" alt=""></p>
<hr>
<p>3&#x3001;androidstudio&#x53C2;&#x6570;&#x5316;&#x6CE8;&#x5165;</p>
<p>gradle.properties</p>
<pre><code>APP_VERSION=1.1.0
IS_JENKINS=true
BUILD_TIME=&apos;&apos;
</code></pre><p>build.gradle</p>
<pre><code>apply plugin: &apos;com.android.application&apos;

static def getDate() {
    def date = new Date()
    def formattedDate = date.format(&apos;yyyy-MM-dd-HH-mm&apos;)
    return formattedDate
}

android {
    signingConfigs {
        release {
            //&#x7531;&#x4E8E;&#x672C;&#x673A;&#x6253;&#x5305;&#x4F7F;&#x7528;&#x7684;&#x662F;&#x672C;&#x673A;&#x4E0A;&#x7684;keystore
            //&#x800C;jenkins&#x6253;&#x5305;&#x7684;&#x662F;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x7684;keystore
            //&#x4E24;&#x4E2A;&#x8DEF;&#x5F84;&#x4E0D;&#x4E00;&#x6837;
            if(&quot;false&quot;.equals(IS_JENKINS))
            {
                storeFile file(&apos;./XiaoLanYunMart.jks&apos;)
            }
            else
            {
                storeFile file(&apos;./XiaoLanYunMart.jks&apos;)
            }
            keyAlias &apos;key0&apos;
            keyPassword &apos;xiaolanyun521&apos;
            //storeFile file(&apos;./XiaoLanYunMart.jks&apos;)
            storePassword &apos;xiaolanyun521&apos;
        }
    }
    compileSdkVersion 26
    defaultConfig {
        applicationId &quot;com.example.xiaolanyun.ldmart&quot;
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        //versionName &quot;1.0&quot;
        versionName APP_VERSION
        testInstrumentationRunner &quot;android.support.test.runner.AndroidJUnitRunner&quot;
    /*
    &#x542F;&#x7528;multiDex&#x652F;&#x6301; &#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x6570; &#x8D85;&#x8FC7; 64k &#x7684;&#x95EE;&#x9898;
     */
    multiDexEnabled true
    /**
     * &#x652F;&#x6301;&#x80CC;&#x666F;&#x6A21;&#x7CCA;
     */
    renderscriptTargetApi 25
    renderscriptSupportModeEnabled true
}
buildTypes {
    release {

        debuggable true
        //&#x4EE3;&#x7801;&#x6DF7;&#x6DC6;
        //minifyEnabled true
        minifyEnabled false
        /*&#x52A0;&#x8F7D;&#x9ED8;&#x8BA4;&#x6DF7;&#x6DC6;&#x914D;&#x7F6E;&#x6587;&#x4EF6;*/
        proguardFiles getDefaultProguardFile(&apos;proguard-android.txt&apos;), &apos;proguard-rules.pro&apos;
        /***
         * zipalign&#x4F18;&#x5316;
         */
        zipAlignEnabled true
        /**
         * &#x79FB;&#x9664;&#x65E0;&#x7528;&#x7684;resource&#x6587;&#x4EF6;
         */
        //shrinkResources true

        /***
         * &#x81EA;&#x5B9A;&#x4E49;&#x5B57;&#x6BB5;&#x3010;true&#xFF1A;&#x6D4B;&#x8BD5;&#x5730;&#x5740; false&#xFF1A;&#x7EBF;&#x4E0A;&#x5730;&#x5740;&#x3011;
         */
        buildConfigField &quot;boolean&quot;, &quot;IS_TEST&quot;, &quot;false&quot;
        /***
         * &#x81EA;&#x5B9A;&#x4E49;&#x5B57;&#x6BB5;&#x3010;true: Jenkins &#x6253;&#x5305; false: AS &#x6253;&#x5305;&#x3011;
         */
        buildConfigField &quot;boolean&quot;, &quot;IS_JENKINS&quot;, &quot;${IS_JENKINS}&quot;

        //&#x7B7E;&#x540D;&#x5F15;&#x7528;
        signingConfig signingConfigs.release
    }
    debug {
        debuggable true
        //minifyEnabled true//&#x6DF7;&#x6DC6;
        minifyEnabled false
        zipAlignEnabled true //zipAlign&#x4F18;&#x5316;
        //shrinkResources true //&#x79FB;&#x9664;&#x65E0;&#x7528;&#x7684;&#x8D44;&#x6E90;&#x6587;&#x4EF6;

        /*&#x52A0;&#x8F7D;&#x9ED8;&#x8BA4;&#x6DF7;&#x6DC6;&#x914D;&#x7F6E;&#x6587;&#x4EF6;*/
        proguardFiles getDefaultProguardFile(&apos;proguard-android.txt&apos;), &apos;proguard-rules.pro&apos;

        /***
         * &#x81EA;&#x5B9A;&#x4E49;&#x5B57;&#x6BB5;&#x3010;true&#xFF1A;&#x6D4B;&#x8BD5;&#x5730;&#x5740; false&#xFF1A;&#x7EBF;&#x4E0A;&#x5730;&#x5740;&#x3011;
         */
        buildConfigField &quot;boolean&quot;, &quot;IS_TEST&quot;, &quot;true&quot;
        /***
         * &#x81EA;&#x5B9A;&#x4E49;&#x5B57;&#x6BB5;&#x3010;true: Jenkins &#x6253;&#x5305; false: AS &#x6253;&#x5305;&#x3011;
         */
        buildConfigField &quot;boolean&quot;, &quot;IS_JENKINS&quot;, &quot;${IS_JENKINS}&quot;

        //&#x7B7E;&#x540D;&#x5F15;&#x7528;
        signingConfig signingConfigs.release
    }
}
/*&#x4FEE;&#x6539;&#x751F;&#x6210;&#x7684;apk&#x540D;&#x5B57;*/
android.applicationVariants.all { variant -&gt;
    variant.outputs.all { output -&gt;
        def newName
        //def timeNow = getDate().substring(5) // &#x53BB;&#x6389;&#x5E74;
        def timeNow

        if (&quot;true&quot; == IS_JENKINS) {

            timeNow = BUILD_TIME
            if (variant.buildType.name == &apos;debug&apos;) {
                newName = &quot;XiaoLanYunMart-v${APP_VERSION}-debug-${timeNow}.apk&quot;
            } else {
                newName = &quot;XiaoLanYunMart-v${APP_VERSION}-release-${timeNow}.apk&quot;
            }

        } else {
            timeNow = getDate();
            newName = &quot;XiaoLanYunMart-v${APP_VERSION}-${timeNow}-&quot; + variant.buildType.name + &quot;.apk&quot;

        }

        // jenkins&#x6253;&#x5305;&#x65F6;&#x4FEE;&#x6539;&#x8F93;&#x51FA;&#x8DEF;&#x5F84;&#x4FDD;&#x5B58;&#x6240;&#x6709;&#x6253;&#x5305;&#x8BB0;&#x5F55;

        if (&quot;true&quot; == IS_JENKINS) {
            // &#x4FEE;&#x6539;&#x8F93;&#x51FA;&#x8DEF;&#x5F84;
            if (&apos;debug&apos; == variant.buildType.name) {
                variant.getPackageApplication().outputDirectory = new File(project.rootDir.absolutePath + &quot;/apk/debug/&quot;)
            } else {
                variant.getPackageApplication().outputDirectory = new File(project.rootDir.absolutePath + &quot;/apk/release/&quot;)
            }
        }

        outputFileName = newName

    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
    abortOnError false
    checkReleaseBuilds false
}
}

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath &apos;org.greenrobot:greendao-gradle-plugin:3.2.1&apos;
    }
}

apply plugin: &apos;org.greenrobot.greendao&apos;

greendao {
    schemaVersion 1
    daoPackage &apos;com.example.leidong.ldmart.greendao&apos;
    targetGenDir &apos;src/main/java&apos;
}

dependencies {
    implementation fileTree(include: [&apos;*.jar&apos;], dir: &apos;libs&apos;)
    //noinspection GradleCompatible
    implementation &apos;com.android.support:appcompat-v7:26.1.0&apos;
    implementation &apos;com.android.support.constraint:constraint-layout:1.0.2&apos;
    testImplementation &apos;junit:junit:4.12&apos;
    androidTestImplementation &apos;com.android.support.test:runner :1.0.1&apos;
    androidTestImplementation &apos;com.android.support.test.espresso:espresso-core:3.0.1&apos;
    /*ButterKnife*/
    implementation &apos;com.jakewharton:butterknife:8.8.1&apos;
    annotationProcessor &apos;com.jakewharton:butterknife-compiler:8.8.1&apos;
    /*BottomBar*/
    implementation &apos;com.roughike:bottom-bar:2.3.1&apos;
    /*RecyclerView*/
    implementation &apos;com.android.support:recyclerview-v7:26.1.0&apos;
    /*Gson*/
    implementation &apos;com.google.code.gson:gson:2.8.2&apos;
    /*GreenDao*/
    implementation &apos;org.greenrobot:greendao:3.0.1&apos;
    implementation &apos;org.greenrobot:greendao-generator:3.0.0&apos;
    /*Picasso*/
    implementation &apos;com.squareup.picasso:picasso:2.71828&apos;
}
</code></pre>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="chapter10.5.html" class="navigation navigation-prev " aria-label="Previous page: 10.5、Android本地商城托管地址">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="chapter11.html" class="navigation navigation-next " aria-label="Next page: 11、Appium_自动化测试框架">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"10.6、Android自动化构建","level":"1.11.6","depth":2,"next":{"title":"11、Appium_自动化测试框架","level":"1.12","depth":1,"path":"chapter11.md","ref":"chapter11.md","articles":[{"title":"11.1、总体设计思路","level":"1.12.1","depth":2,"path":"chapter11.1.md","ref":"chapter11.1.md","articles":[]},{"title":"11.2、环境","level":"1.12.2","depth":2,"path":"chapter11.2.md","ref":"chapter11.2.md","articles":[]},{"title":"11.3、自动化测试框架","level":"1.12.3","depth":2,"path":"chapter11.3.md","ref":"chapter11.3.md","articles":[]},{"title":"11.4、自动化测试框架托管地址","level":"1.12.4","depth":2,"path":"chapter11.4.md","ref":"chapter11.4.md","articles":[]},{"title":"11.5、并行测试","level":"1.12.5","depth":2,"path":"chapter11.5.md","ref":"chapter11.5.md","articles":[]},{"title":"11.6、并行测试框架托管地址","level":"1.12.6","depth":2,"path":"chapter11.6.md","ref":"chapter11.6.md","articles":[]},{"title":"11.7、持续集成","level":"1.12.7","depth":2,"path":"chapter11.7.md","ref":"chapter11.7.md","articles":[]}]},"previous":{"title":"10.5、Android本地商城托管地址","level":"1.11.5","depth":2,"path":"chapter10.5.md","ref":"chapter10.5.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["back-to-top-button","chapter-fold","expandable-chapters-small","insert-logo","splitter","popup","github","github-buttons","livereload"],"pluginsConfig":{"chapter-fold":{},"github":{"url":"https://github.com/xiaolanyun","size":"50px"},"livereload":{},"splitter":{},"search":{},"popup":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"github-buttons":{"buttons":[{"user":"xiaolanyun","repo":"DevOps_wiki","type":"star","size":"30px"}]},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"insert-logo":{"style":"background: none; max-height: 60px; min-height: 30px","url":"http://server.zzidc.com/uploads/allimg/171120/1-1G120162T3202.png"}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapter10.6.md","mtime":"2019-04-27T03:58:14.462Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-07T07:59:20.478Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

